## -*- mode: html; coding: utf-8; -*-

## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## CDS Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

<!-- WebDoc-Page-Title: WebJournal Table Structure -->
<!-- WebDoc-Page-Navtrail: <a class="navtrail" href="<CFG_SITE_URL>/help/hacking">Hacking CDS Invenio</a> &gt; <a class="navtrail" href="webjournal-internals">WebJournal Internals</a> -->
<!-- WebDoc-Page-Revision: $Id$ -->

<pre>
Most of the data concerning WebJournal is self-contained in the
articles metadata. Hence the tables used by WebJournal are quite
basic, and mainly records the release time of each issue.

It remains necessary to understand these tables in case a journal
editor released an issue by mistake, or grouped issues while they
should not, etc.

-- jrnJOURNAL --

list of the journal managed by WebJournal

     id - the id of the journal

   name - the name of the journal (as displayed in the URL, not the
          nice name with spaces, capitalization, etc).


-- jrnISSUE --

list of the existing issues of a journal. WebJournal expects to find
entries of released issues here (unless 'hide_unreleased_issues' is
configured specifically in your journal XML configuration).

    id_jrnJOURNAL - the id of the journal

     issue_number - the issue number, in the form "digit/year".

    issue_display - how the issue number is display. It is different
                    from issue_number column when several issues have
                    been grouped together. Eg:

    date_released - the time this issue was released. It the date is
                    not set, the issue is not considered as released.

   date_announced - the time the alert was sent for this issue

                             ~  ~  ~

It is quite safe to delete, edit and add entries manually in these
tables. If a journal editor released an issue by mistake, you can
delete the corresponding issue from the table. Eg:

$ echo "SELECT id FROM jrnJOURNAL WHERE name='AtlantisTimes'" | /opt/cds-invenio/bin/dbexec
  ----
 | id |
  ----
 | 1  |
  ----

$ echo "DELETE FROM jrnISSUE WHERE id_jrnJOURNAL=1 and issue_number='07/2009'" | /opt/cds-invenio/bin/dbexec

Note however that articles remain visible on the main CDS Invenio
interface, in your journal collection.


If a journal editor grouped two issues by mistake, you can change the
'issue_display' column value to be the same as the 'issue_number'
column. Eg:

$ echo "SELECT issue_number, issue_display FROM jrnISSUE WHERE id_jrnJOURNAL=1" | /opt/cds-invenio/bin/dbexec

  -----------------------------
 | issue_number  issue_display |
  -----------------------------
 | 07/2009       06-07/2009    |
 | 06/2009       06-07/2009    |
  -----------------------------

$ echo "UPDATE jrnISSUE set issue_display='07/2009' WHERE id_jrnJOURNAL=1 AND issue_number='07/2009'" | /opt/cds-invenio/bin/dbexec
$ echo "UPDATE jrnISSUE set issue_display='06/2009' WHERE id_jrnJOURNAL=1 AND issue_number='06/2009'" | /opt/cds-invenio/bin/dbexec

You can leave the '07/2009' if it has no release date. You should
remove it if it has a release date while the issue should not have
been released.

</pre>
